package com.clever.mall.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor  //无参构造
@AllArgsConstructor //有参构造
public class Message {
    /**
     * 消息id
     */
    private Integer msgId;

    /**
     * 发送者的id
     */
    private Integer userFromId;

    /**
     * 接收者的ID
     */
    private Integer userToId;

    /**
     * 产品ID，如果消息类型为购买，则产品id不能为空
     */
    private Integer productId;

    /**
     * 消息类型：
     * 0表示fromUser关注toUser，
     * 1表示fromUser取消关注toUser，
     * 2表示fromUser购买toUser的商品
     */
    private Integer msgType;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 消息创建时间
     */
    private Date createTime;

    /**
     * 是否查看 0表示未查看1表示已经查看
     */
    private Integer isView;

    /**
     * 是否删除 默认为0
     */
    private Integer isDel;

    public Message(Integer msgId, Integer userFromId, Integer userToId, Integer productId,
                   Integer msgType, String content, Date createTime, Integer isView) {
        this.msgId = msgId;
        this.userFromId = userFromId;
        this.userToId = userToId;
        this.productId = productId;
        this.msgType = msgType;
        this.content = content;
        this.createTime = createTime;
        this.isView = isView;
    }
}

